package com.crystal.jcms.frament;


import com.crystal.constant.Constant;
import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;
import android.text.TextUtils;

public class BaseFragment  extends Fragment {
	
	public static final String TAG="zftphone";
	
	public Activity mContext;
	
	//使用方法重载间接实现“默认参数”效果
	public static BaseFragment newInstance(String tag) {
		return newInstance(tag,null);
	}
	
	public static BaseFragment newInstance(String tag,Bundle bundle) {
		BaseFragment fragment=null;
		if (TextUtils.equals(tag,Constant.STR_FRAGMENT_APPS)) {
			fragment=new MenuFrament();
		}else if (TextUtils.equals(tag,Constant.STR_FRAGMENT_SET)) {
			fragment=new SetFragment();
		}
		if(bundle != null){
			fragment.setArguments(bundle);
		}
		
		return fragment;
	}
	
	@Override
	public void onAttach(Activity activity) {
		super.onAttach(activity);
		this.mContext = activity;
	}

}
